package com.oamic.sdk.picker.pickerview.configure;

import android.content.Context;
import android.graphics.Typeface;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;

import com.oamic.sdk.picker.R;
import com.oamic.sdk.picker.pickerview.listener.CustomListener;
import com.oamic.sdk.picker.pickerview.listener.OnOptionsSelectChangeListener;
import com.oamic.sdk.picker.pickerview.listener.OnOptionsSelectListener;
import com.oamic.sdk.picker.pickerview.listener.OnTimeSelectChangeListener;
import com.oamic.sdk.picker.pickerview.listener.OnTimeSelectListener;
import com.oamic.sdk.picker.wheelview.view.WheelView;

import java.util.Calendar;

/**
 * Build Options
 * Created by xiaosongzeem on 2018/3/8.
 */

public class PickerOptions {
    public static final int TYPE_PICKER_OPTIONS = 1;
    public static final int TYPE_PICKER_TIME = 2;
    
    public OnOptionsSelectListener optionsSelectListener;
    public OnTimeSelectListener timeSelectListener;
    public View.OnClickListener cancelListener;
    
    public OnTimeSelectChangeListener timeSelectChangeListener;
    public OnOptionsSelectChangeListener optionsSelectChangeListener;
    public CustomListener customListener;
    
    //options picker
    public String label1, label2, label3;//单位字符
    public int mCurrentSelectOption1, mCurrentSelectOption2, mCurrentSelectOption3;//默认选中项
    public int x_offset_one, x_offset_two, x_offset_three;//x轴偏移量
    
    public boolean cyclic1 = false;//是否循环，默认否
    public boolean cyclic2 = false;
    public boolean cyclic3 = false;
    
    public boolean isRestoreItem = false; //切换时，还原第一项
    
    
    //time picker
    public boolean dayIsShowWeek = false;//日期显示星期出来 默认不显示
    public boolean[] type = new boolean[]{true, true, true, false, false, false};//显示类型，默认显示： 年月日
    
    //当前选中时间
    protected Calendar mCurrentSelectDate;
    //开始时间
    protected Calendar mStartDate;
    //终止时间
    protected Calendar mEndDate;
    
    public boolean cyclic = false;//是否循环
    public boolean isLunarCalendar = false;//是否显示农历
    
    public String label_year, label_month, label_day, label_hours, label_minutes, label_seconds;//单位
    public int x_offset_year, x_offset_month, x_offset_day, x_offset_hours, x_offset_minutes, x_offset_seconds;//单位
    
    
    public PickerOptions(int buildType) {
        if (buildType == TYPE_PICKER_OPTIONS) {
            layoutRes = R.layout.pickerview_options;
        } else {
            layoutRes = R.layout.pickerview_time;
        }
    }
    
    //******* general field ******//
    public int layoutRes;
    public ViewGroup decorView;
    public int textGravity = Gravity.CENTER;
    public Context context;
    
    public String textContentConfirm;//确定按钮文字
    public String textContentCancel;//取消按钮文字
    public String textContentTitle;//标题文字
    
    public int textColorConfirm = R.color.sl_font_white;//确定按钮颜色
    public int textColorCancel = R.color.sl_font_negative;//取消按钮颜色
    public int textColorTitle = R.color.common_font_black_66;//标题颜色
    
    //标题背景颜色
    public int bgColorTitle = R.drawable.bg_select_dialog_bar;
    
    public int textSizeSubmitCancel = 17;//确定取消按钮大小
    public int textSizeTitle = 16;//标题文字大小
    public int textSizeContent = 18;//内容文字大小
    
    public int textColorOut = R.color.common_font_black_99; //分割线以外的文字颜色
    public int textColorCenter = R.color.colorPrimary; //分割线之间的文字颜色
    public int outSideColor = -1; //显示时的外部背景色颜色,默认是灰色
    public int selectItemBgColor = R.color.colorAccent; //选中条目的背景色
    
    public float lineSpacingMultiplier = 3f; // 条目间距倍数 默认1.6
    public boolean isDialog;//是否是对话框模式
    
    public boolean cancelable = true;//是否能取消
    public boolean isCenterLabel = false;//是否只显示中间的label,默认每个item都显示
    public Typeface font = Typeface.MONOSPACE;//字体样式
    public WheelView.DividerType dividerType = WheelView.DividerType.FILL;//分隔线类型
    public int itemsVisibleCount = 9; //最大可见条目数
    public boolean isAlphaGradient = true; //透明度渐变
    
    public Calendar getCurrentSelectDate() {
        return mCurrentSelectDate;
    }
    
    public void setCurrentSelectDate(Calendar currentSelectDate) {
        mCurrentSelectDate = currentSelectDate;
    }
    
    public Calendar getStartDate() {
        return mStartDate;
    }
    
    public void setStartDate(Calendar startDate) {
        mStartDate = startDate;
    }
    
    public Calendar getEndDate() {
        return mEndDate;
    }
    
    public void setEndDate(Calendar endDate) {
        mEndDate = endDate;
    }
}
